package com.example.springstudy.controller;

import com.example.springstudy.base.Result;
import com.example.springstudy.mapper.DictMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/dict")
public class DictController {
    @Autowired
    DictMapper  dictMapper;

    @GetMapping("/{code}")
    public Result<?> getDictByCode(@PathVariable String code) {
        return Result.success(dictMapper.listDict(code));
    }
}
